<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/reset.css" />
		<link rel="stylesheet" type="text/css" href="../css/head.css" />
		<link rel="stylesheet" type="text/css" href="../css/register19.css" />
		<script src="../js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div class="head">
			<img onclick="history.go(-1)" src="../img/xiaoyu.png" alt="" class="img_fan" />
			<h2>玩咖用户注册</h2>
			<a class="rightr" href="register16.html">登录</a>
		</div>

		<form action="" method="post" class="register">
			<input type="text" class="shouji" placeholder="所注册的手机号" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'') " name="" value="" />

			<input type="text" class="yzm" placeholder="请输入验证码" onkeyup="this.value=this.value.replace(/[^\d]/g,'') " onafterpaste="this.value=this.value.replace(/[^\d]/g,'') " name="" value="" />
			<span onclick=checkPhone() class="huoqu">获取验证</span>
			<input type="" name="" id="xmm1" value="" placeholder="您的新密码" />
			<input type="" name="" id="xmm2" value="" placeholder="您的新密码" />

		</form>
		<a></a>
		<span class="sub" onclick=zhuce()>注册</span>

	</body>
	<script type="text/javascript">
		var t = 10;

		function checkPhone() {

			var phone = $('.shouji').val()
			if(phone.length == '0') {
				alert("请输入手机号");
			} else if(!(/^1[34578]\d{9}$/.test(phone))) {
				alert("手机号码有误，请重填");
				return false;
			} else {
				var timer = setInterval(function() {
					t--;
					$('.huoqu').text('再次获取(' + t + ')')
					if(t == 0) {
						t = 10;
						clearInterval(timer)
						$('.huoqu').text('再次获')
					}

				}, 1000)
			}
		}

		function zhuce() {
			$('.sub').click(function() {
				if(!($('.yzm').val().length == 4)) {
					alert('验证码不正确')
					return false
				}
			})

			if($('#xmm1').val() == '' || $('#xmm2').val() == '') {
				alert('请重新输入')
			} else if(!($('#xmm1').val() == $('#xmm2').val())) {
				alert('两次密码不同')
			} else {
				window.location.href = 'register16.html';

			}

		}
	</script>

</html>